package org.jsola.contract.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import javax.validation.constraints.NotNull;

import static org.jsola.contract.example.TemplateExample.E_CATEGORY_ID;
import static org.jsola.contract.example.TemplateExample.E_CONTENT;
import static org.jsola.contract.example.TemplateExample.E_CONTENT_JSON;
import static org.jsola.contract.example.TemplateExample.E_NAME;
import static org.jsola.contract.example.TemplateExample.E_TOTAL_PAGE;
import static org.jsola.contract.example.TemplateExample.M_CATEGORY_ID_NOT_NULL;
import static org.jsola.contract.example.TemplateExample.M_CONTENT_JSON_MAX;
import static org.jsola.contract.example.TemplateExample.M_CONTENT_MAX;
import static org.jsola.contract.example.TemplateExample.M_NAME_MAX;
import static org.jsola.contract.example.TemplateExample.M_NAME_NOT_NULL;
import static org.jsola.contract.example.TemplateExample.N_CATEGORY_ID;
import static org.jsola.contract.example.TemplateExample.N_CONTENT;
import static org.jsola.contract.example.TemplateExample.N_CONTENT_JSON;
import static org.jsola.contract.example.TemplateExample.N_NAME;
import static org.jsola.contract.example.TemplateExample.N_TOTAL_PAGE;
import static org.jsola.core.example.BaseExample.E_ID;
import static org.jsola.core.example.BaseExample.M_ID_NOT_NULL;
import static org.jsola.core.example.BaseExample.N_ID;

/**
 * 合同模板
 *
 * @author JanusMix
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "修改【合同模板】的参数")
@Data
public class TemplateUpdateDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_ID, example = E_ID, required = true)
    @NotNull(message = M_ID_NOT_NULL)
    private Long id;

    @ApiModelProperty(notes = N_NAME, example = E_NAME, required = true)
    @NotNull(message = M_NAME_NOT_NULL)
    @Length(max = 255, message = M_NAME_MAX)
    private String name;

    @ApiModelProperty(notes = N_CATEGORY_ID, example = E_CATEGORY_ID, required = true)
    @NotNull(message = M_CATEGORY_ID_NOT_NULL)
    private Long categoryId;

    @ApiModelProperty(notes = N_CONTENT, example = E_CONTENT)
    @Length(max = 2147483647, message = M_CONTENT_MAX)
    private String content;

    @ApiModelProperty(notes = N_CONTENT_JSON, example = E_CONTENT_JSON)
    @Length(max = 2147483647, message = M_CONTENT_JSON_MAX)
    private String contentJson;

    @ApiModelProperty(notes = N_TOTAL_PAGE, example = E_TOTAL_PAGE)
    private Integer totalPage;


}

